lib: Add a private helper to abort txns, use in sysroot cleanup
authorColin Walters <walters@verbum.org>
Tue, 5 Sep 2017 19:43:04 +0000 (15:43 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 8 Sep 2017 16:25:06 +0000 (16:25 +0000)
commit3594bb2d0f6818a97adc95655bd136267e27fe4c
tree2ecc3caaab4c9e0d97298c6d2f0e30316f5b4f85
parent6be4dfe66e713cf9dea32fb8df551c4e8b62d39c
lib: Add a private helper to abort txns, use in sysroot cleanup

Steal some code from flatpak for this, which allows porting a few more things to
new style. I started on a public API version of this but was trying to roll some
other things into it and it snowballed. Let's do this version since it's easy
for now.

While here I changed things so that `generate_deployment_refs()` now just uses
`_set_ref_immediate()` rather than requring a txn.

Also, AFAICS there was no test coverage of `generate_deployment_refs()`; I tried
commenting it out and at least `admin-test.sh` passed. Add some coverage of this
- I verified that with this commenting out bits of that function cause the test
to fail.

Closes: #1132
Approved by: jlebon
src/libostree/ostree-repo-private.h
src/libostree/ostree-sysroot-cleanup.c
tests/admin-test.sh